1. Field of the Invention
This invention relates to a labeling method for use in processing of binary image and an apparatus thereof.
2. Description of the Prior Art
When processing an image having plural spots (patterns) on the background, a label is assigned to images constituting each spot thereby to identify which spot each image belongs to. The processing procedure is divided in three steps as follows:
(1) Primary labeling
Since the image data is obtained through raster scanning, it is processed according to the scanning order. When the continuity is recognized in a present image to the just-passed image, the same label is assigned to the present image, but when having no continuity, a new label is assigned to the present image.
(2) Unification process
Pixels with different labels assigned subsequent to the above primary labeling are unified if they belong to the same spot.
(3) Secondary labeling
An unifying label is assigned to the images belonging to the same spot as a result of the unification.
An example of the conventional primary labeling method is revealed in Japanese Patent Publication No. 2-48778 (1990). In the conventional method, supposing that a target image for labeling is expressed by (i,j), it is necessary for the purpose of labeling to refer to six images, namely, the subject image, three images in the upper line (i-1,j-1), (i-1,j), (i-1,j+1), and adjacent two images (i,j-1), (i,j+1) in the same line.
Though the labeling is actually achieved in the above-described manner, to save hardwares is greatly demanded in recent years.